var $;
var from;
var wellids;
var name;
layui.use(['form', 'colorpicker', 'layer'], function () {
  $ = layui.$;
  from = layui.form;
  var colorpicker = layui.colorpicker;
  var layer = layui.layer;

  $("#ig1").click(function () {
    var well = wellids;
    layer.open({
      type: 2,
      content: './Images.html',
      area: ['800px', '400px'],
      btn: ['确认'],
      success: function (layero, index) {
        var iframe = window["layui-layer-iframe" + index]
        iframe.imglist(well, name);
      },
      yes: function (index) {
        var res = window["layui-layer-iframe" + index].resdate();
        $("#img1").attr("src", res.pic)
        $("#img1").attr("title", res.code)
        layer.close(index)
      }
    })
  })
  $("#ig2").click(function () {
    var well = wellids;
    layer.open({
      type: 2,
      content: './Images.html',
      area: ['800px', '400px'],
      btn: ['确认'],
      success: function (layero, index) {
        var iframe = window["layui-layer-iframe" + index]
        iframe.imglist(well, name);
      },
      yes: function (index) {
        var res = window["layui-layer-iframe" + index].resdate();
        $("#img2").attr("src", res.pic)
        $("#img2").attr("title", res.code)
        layer.close(index)
      }
    })
  })
  $("#ig3").click(function () {
    layer.open({
      type: 2,
      content: './Images.html',
      area: ['800px', '400px'],
      btn: ['确认'],
      success: function (layero, index) {
        var iframe = window["layui-layer-iframe" + index]
        iframe.imglist(wellids, name);
      },
      yes: function (index) {
        var res = window["layui-layer-iframe" + index].resdate();
        $("#img3").attr("src", res.pic)
        $("#img3").attr("title", res.code)
        layer.close(index)
      }
    })
  })
  $("#ig4").click(function () {
    layer.open({
      type: 2,
      content: './Images.html',
      area: ['800px', '400px'],
      btn: ['确认'],
      success: function (layero, index) {
        var iframe = window["layui-layer-iframe" + index]
        iframe.imglist(wellids, name);
      },
      yes: function (index) {
        var res = window["layui-layer-iframe" + index].resdate();
        $("#img4").attr("src", res.pic)
        $("#img4").attr("title", res.code)
        layer.close(index)
      }
    })
  })
  $("#ig5").click(function () {
    layer.open({
      type: 2,
      content: './Images.html',
      area: ['800px', '400px'],
      btn: ['确认'],
      success: function (layero, index) {
        var iframe = window["layui-layer-iframe" + index]
        iframe.imglist(wellids, name);
      },
      yes: function (index) {
        var res = window["layui-layer-iframe" + index].resdate();
        $("#img5").attr("src", res.pic)
        $("#img5").attr("title", res.code)
        layer.close(index)
      }
    })
  })
  $("#ig6").click(function () {
    layer.open({
      type: 2,
      content: './Images.html',
      area: ['800px', '400px'],
      btn: ['确认'],
      success: function (layero, index) {
        var iframe = window["layui-layer-iframe" + index]
        iframe.imglist(wellids, name);
      },
      yes: function (index) {
        var res = window["layui-layer-iframe" + index].resdate();
        $("#img6").attr("src", res.pic)
        $("#img6").attr("title", res.code)
        layer.close(index)
      }
    })
  })
  $("#ig7").click(function () {
    layer.open({
      type: 2,
      content: './Images.html',
      area: ['800px', '400px'],
      btn: ['确认'],
      success: function (layero, index) {
        var iframe = window["layui-layer-iframe" + index]
        iframe.imglist(wellids, name);
      },
      yes: function (index) {
        var res = window["layui-layer-iframe" + index].resdate();
        $("#img7").attr("src", res.pic)
        $("#img7").attr("title", res.code)
        layer.close(index)
      }
    })
  })
  $("#ig8").click(function () {
    layer.open({
      type: 2,
      content: './Images.html',
      area: ['800px', '400px'],
      btn: ['确认'],
      success: function (layero, index) {
        var iframe = window["layui-layer-iframe" + index]
        iframe.imglist(wellids, name);
      },
      yes: function (index) {
        var res = window["layui-layer-iframe" + index].resdate();
        $("#img8").attr("src", res.pic)
        $("#img8").attr("title", res.code)
        layer.close(index)
      }
    })
  })
  $("#ig9").click(function () {
    layer.open({
      type: 2,
      content: './Images.html',
      area: ['800px', '400px'],
      btn: ['确认'],
      success: function (layero, index) {
        var iframe = window["layui-layer-iframe" + index]
        iframe.imglist(wellids, name);
      },
      yes: function (index) {
        var res = window["layui-layer-iframe" + index].resdate();
        $("#img9").attr("src", res.pic)
        $("#img9").attr("title", res.code)
        layer.close(index)
      }
    })
  })
  $("#ig10").click(function () {
    layer.open({
      type: 2,
      content: './Images.html',
      area: ['800px', '400px'],
      btn: ['确认'],
      success: function (layero, index) {
        var iframe = window["layui-layer-iframe" + index]
        iframe.imglist(wellids, name);
      },
      yes: function (index) {
        var res = window["layui-layer-iframe" + index].resdate();
        $("#img10").attr("src", res.pic)
        $("#img10").attr("title", res.code)
        layer.close(index)
      }
    })
  })
  $("#ig11").click(function () {
    layer.open({
      type: 2,
      content: './Images.html',
      area: ['800px', '400px'],
      btn: ['确认'],
      success: function (layero, index) {
        var iframe = window["layui-layer-iframe" + index]
        iframe.imglist(wellids, name);
      },
      yes: function (index) {
        var res = window["layui-layer-iframe" + index].resdate();
        $("#img11").attr("src", res.pic)
        $("#img11").attr("title", res.code)
        layer.close(index)
      }
    })
  })
  $("#ig12").click(function () {
    layer.open({
      type: 2,
      content: './Images.html',
      area: ['800px', '400px'],
      btn: ['确认'],
      success: function (layero, index) {
        var iframe = window["layui-layer-iframe" + index]
        iframe.imglist(wellids, name);
      },
      yes: function (index) {
        var res = window["layui-layer-iframe" + index].resdate();
        $("#img12").attr("src", res.pic)
        $("#img12").attr("title", res.code)
        layer.close(index)
      }
    })
  })

})

function child(wellid, dbname) {
  wellids = wellid;
  name = dbname;
}
var resdata = function () {
  let arry = []
  var depthstart1 = $("#de1").val();
  var depthend1 = $("#de2").val();
  var ty1 = $("#img1").attr('title')
  var pc1 = $("#deps1").val()
  arry.push({ ty1, pc1 })
  var ty2 = $("#img2").attr('title')
  var pc2 = $("#deps2").val()
  arry.push({ ty2, pc2 })
  var ty3 = $("#img3").attr('title')
  var pc3 = $("#deps3").val()
  arry.push({ ty3, pc3 })
  var ty4 = $("#img4").attr('title')
  var pc4 = $("#deps4").val()
  arry.push({ ty4, pc4 })
  var ty5 = $("#img5").attr('title')
  var pc5 = $("#deps5").val()
  arry.push({ ty5, pc5 })
  var ty6 = $("#img6").attr('title')
  var pc6 = $("#deps6").val()
  arry.push({ ty6, pc6 })

  let arrt = [];
  var depthstart = $("#dep1").val();
  var depthend = $("#dep2").val();
  var ty = $("#img7").attr('title')
  var pc = $("#deps7").val()
  if (ty == "") {
    ty = "99"
  }
  arrt.push({ ty, pc })
  var ty = $("#img8").attr('title')
  var pc = $("#deps8").val()
  if (ty == "") {
    ty = "99"
  }
  arrt.push({ ty, pc })
  var ty = $("#img9").attr('title')
  var pc = $("#deps9").val()
  if (ty == "") {
    ty = "99"
  }
  arrt.push({ ty, pc })
  var ty = $("#img10").attr('title')
  var pc = $("#deps10").val()
  if (ty == "") {
    ty = "99"
  }
  arrt.push({ ty, pc })
  var ty = $("#img11").attr('title')
  var pc = $("#deps11").val()
  if (ty == "") {
    ty = "99"
  }
  arrt.push({ ty, pc })
  var ty = $("#img12").attr('title')
  var pc = $("#deps12").val()
  if (ty == "") {
    ty = "99"
  }
  arrt.push({ ty, pc })
  let date = { depthstart, depthend, arrt }
  return date;
}